#!/usr/bin/python3
# @Time    : 2024-08-04 下午 8:25
# @Author  : MingYangHe
# @Email   : 1780040868@qq.com
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
import time
# 指定ChromeDriver的路径
chromedriver_path = r"C:\Program Files\Google\Chrome\Application\chromedriver.exe"

# 创建一个Service对象，并传递chromedriver的路径
service = Service(executable_path=chromedriver_path)

# 创建WebDriver对象，不再使用executable_path参数
driver = webdriver.Chrome(service=service)


def main():
    driver.get("https://www.baidu.com")
    # 其他操作...
    time.sleep(5)

if __name__ == "__main__":
    main()